﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<DomainModel.Entities.Artist>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Index</h2>
    <p>
        <%: Html.ActionLink("Create New", "Create") %>
    </p>
    <table>
        <tr>
            <th>
            Picture
            </th>
            <th>
                Artist Name
            </th>
            <th>
               Description
            </th>
            <th>
               Approved
            </th>
             <th>
             Actions
            </th>
        </tr>
        <% foreach (var item in Model)
           { %>
        <tr>
        <td>
         <%= Html.Image(item.SmallPicture, new { width="80", height="80" })%>
        </td>            
            <td>
                <%: item.ArtistName %>
            </td>
            <td>
                <%: item.ArtistDesc %>
            </td>
             <td>
                <%: item.IsApproved %>
            </td>
            <td>
                <%: Html.ActionLink("Edit", "Edit", new { id=item.ArtistID }) %>
                |
                <%: Html.ActionLink("Details", "Details", new { id=item.ArtistID }) %>
                |
                <%: Html.ActionLink("Delete", "Delete", new { id=item.ArtistID }) %>
            </td>
        </tr>
        <% } %>
    </table>
</asp:Content>

<%--<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>List Artist</h2>
    <div id="grid"> 
        <% var grid = new WebGrid(source: Model, defaultSort: "ArtistName", rowsPerPage: 10); %> 
        <%=grid.GetHtml(
            tableStyle: "grid",
            headerStyle: "head",
            alternatingRowStyle: "alt",
            columns: grid.Columns(
                    grid.Column(format: (item) => Html.ActionLink("Album Details", "Details", new { id = item.ArtistID })),
                    grid.Column(format: (item) => Html.ActionLink("Edit", "Edit", new { id = item.ArtistID })),
                    grid.Column(format: (item) => Html.ActionLink("Delete", "Delete", null, new { onclick = string.Format("deleteRecord('Artist', '{0}')", item.ArtistID), @class = "Delete", href = "JavaScript:void(0)" })),
                    grid.Column("ArtistName", "Artist Name"),
                    grid.Column("ArtistDesc", "Artist Description")))
        %> 
    </div>
</asp:Content>--%>
